package Dome1;

public class Test1 {
    public static void main(String[] args) {
        Student stu = new Student();
        try {
            stu.setAge(16);
            System.out.println(stu.getAge());

        }catch (AgeException e){
            e.printStackTrace();
            System.out.println("出现异常");

        }
        try {
            stu.setSex("男");
            System.out.println(stu.getSex());
        }catch (SexException e){
            e.printStackTrace();
            System.out.println("出现异常");
        }

    }
}
